package com.sky.mapper;

import com.sky.entity.OrderDetail;
import com.sky.entity.Orders;
import com.sky.entity.ShoppingCart;
import com.sky.vo.OrderSubmitVO;
import com.sky.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrdersMapper {
    List<OrderVO> getOrdersList(Integer status, Long userId);

    OrderVO getOrdersById(String id);
    Orders getRepetitionById(String id, Long userId);

    void getCancelById(String id, Long userId);

    void insertSubmit(Orders orders);

    OrderSubmitVO selectOrder(String numId, Long userId);

    void insertOrderDetail(OrderDetail orderDetail);

    List<OrderDetail> selectByOrderId(Long id);

    List<OrderDetail> getOrderDetailById(String id);

    void deleteById(Orders orders);

    List<OrderDetail> getByUserId(String id);

    void updateByNumber(Orders order);

    @Select("select * from orders where number = #{number}")
    Orders selectByNumber(String number);
}
